/*
 * @Description:
 * @Author:
 * @Date: 2024-12-07 12:53:42
 * @LastEditTime: 2025-02-16 15:24:19
 * @LastEditors: XXX
 */
import { ContentType, Method, type RequestParams } from 'axios-mapper'
import https from '@/utils/https'
import type { LoginModel } from '@/views/user-manager/login/model/loginModel'
import type { RootObject } from '@/model/rootObject'
import type { UserInfoModel, Users } from '@/model/userModel'

export const loginRequest = (userInfo: RequestParams) => {
  console.log('AAA userInfo :>> ', userInfo);
  return https(false).request<RootObject<LoginModel>>('user/login', Method.POST, userInfo, ContentType.json)
}

export const userInfoRequest = () => {
  return https().request<RootObject<UserInfoModel>>('user/userInfo', Method.GET, undefined, ContentType.form)
}

export const getUsers = (user: any) => {
  return https().request<RootObject<Users>>('user/getUsers', Method.GET, user, ContentType.form)
}
